package com.jrzh.mvc.search.sys;

import org.apache.commons.lang.StringUtils;
import com.jrzh.framework.searchutils.Criteria;
import com.jrzh.framework.searchutils.Restrictions;
import com.jrzh.framework.base.search.BaseSearch;

public class MessageChannelSearch extends BaseSearch{
	private static final long serialVersionUID = 1L;
	
    /**
     * Equal 通道编号
     */
    private String equalCode;
    
    /**
     * Like 通道编号
     */
    private String likeCode;
    
     /**
     * In 通道编号 英文逗号分隔
     */
    private String inCodes;
    
    /**
     * Equal 所属模块
     */
    private String equalModule;
    
    /**
     * Like 所属模块
     */
    private String likeModule;
    
     /**
     * In 所属模块 英文逗号分隔
     */
    private String inModules;
    
    /**
     * Equal 通道类型
     */
    private String equalType;
    
    /**
     * Like 通道类型
     */
    private String likeType;
    
     /**
     * In 通道类型 英文逗号分隔
     */
    private String inTypes;
    
    /**
     * Equal 接收id
     */
    private String equalReciveId;
    
    /**
     * Like 接收id
     */
    private String likeReciveId;
    
     /**
     * In 接收id 英文逗号分隔
     */
    private String inReciveIds;
    
    /**
     * Equal 发送id
     */
    private String equalSendId;
    
    /**
     * Like 发送id
     */
    private String likeSendId;
    
     /**
     * In 发送id 英文逗号分隔
     */
    private String inSendIds;
    
    /**
     * Equal 消息内容（JSON格式字符串）
     */
    private String equalData;
    
    /**
     * Like 消息内容（JSON格式字符串）
     */
    private String likeData;
    
     /**
     * In 消息内容（JSON格式字符串） 英文逗号分隔
     */
    private String inDatas;
    
    /**
     * Equal 扩展信息内容（JSON格式字符串）
     */
    private String equalExpandData;
    
    /**
     * Like 扩展信息内容（JSON格式字符串）
     */
    private String likeExpandData;
    
     /**
     * In 扩展信息内容（JSON格式字符串） 英文逗号分隔
     */
    private String inExpandDatas;
    

    public void setEqualCode(String equalCode) {
        this.equalCode = equalCode;
    }
    
    public String getEqualCode() {
        return this.equalCode;
    }
    
    public void setLikeCode(String likeCode) {
        this.likeCode = likeCode;
    }
    
    public String getLikeCode() {
        return this.likeCode;
    }
    
    public void setInCodes(String inCodes) {
        this.inCodes = inCodes;
    }
    
    public String getInCodes() {
        return this.inCodes;
    }
    public void setEqualModule(String equalModule) {
        this.equalModule = equalModule;
    }
    
    public String getEqualModule() {
        return this.equalModule;
    }
    
    public void setLikeModule(String likeModule) {
        this.likeModule = likeModule;
    }
    
    public String getLikeModule() {
        return this.likeModule;
    }
    
    public void setInModules(String inModules) {
        this.inModules = inModules;
    }
    
    public String getInModules() {
        return this.inModules;
    }
    public void setEqualType(String equalType) {
        this.equalType = equalType;
    }
    
    public String getEqualType() {
        return this.equalType;
    }
    
    public void setLikeType(String likeType) {
        this.likeType = likeType;
    }
    
    public String getLikeType() {
        return this.likeType;
    }
    
    public void setInTypes(String inTypes) {
        this.inTypes = inTypes;
    }
    
    public String getInTypes() {
        return this.inTypes;
    }
    public void setEqualReciveId(String equalReciveId) {
        this.equalReciveId = equalReciveId;
    }
    
    public String getEqualReciveId() {
        return this.equalReciveId;
    }
    
    public void setLikeReciveId(String likeReciveId) {
        this.likeReciveId = likeReciveId;
    }
    
    public String getLikeReciveId() {
        return this.likeReciveId;
    }
    
    public void setInReciveIds(String inReciveIds) {
        this.inReciveIds = inReciveIds;
    }
    
    public String getInReciveIds() {
        return this.inReciveIds;
    }
    public void setEqualSendId(String equalSendId) {
        this.equalSendId = equalSendId;
    }
    
    public String getEqualSendId() {
        return this.equalSendId;
    }
    
    public void setLikeSendId(String likeSendId) {
        this.likeSendId = likeSendId;
    }
    
    public String getLikeSendId() {
        return this.likeSendId;
    }
    
    public void setInSendIds(String inSendIds) {
        this.inSendIds = inSendIds;
    }
    
    public String getInSendIds() {
        return this.inSendIds;
    }
    public void setEqualData(String equalData) {
        this.equalData = equalData;
    }
    
    public String getEqualData() {
        return this.equalData;
    }
    
    public void setLikeData(String likeData) {
        this.likeData = likeData;
    }
    
    public String getLikeData() {
        return this.likeData;
    }
    
    public void setInDatas(String inDatas) {
        this.inDatas = inDatas;
    }
    
    public String getInDatas() {
        return this.inDatas;
    }
    public void setEqualExpandData(String equalExpandData) {
        this.equalExpandData = equalExpandData;
    }
    
    public String getEqualExpandData() {
        return this.equalExpandData;
    }
    
    public void setLikeExpandData(String likeExpandData) {
        this.likeExpandData = likeExpandData;
    }
    
    public String getLikeExpandData() {
        return this.likeExpandData;
    }
    
    public void setInExpandDatas(String inExpandDatas) {
        this.inExpandDatas = inExpandDatas;
    }
    
    public String getInExpandDatas() {
        return this.inExpandDatas;
    }

	@Override
	public void setCriterias(Criteria<?> criterias) {
	    if(StringUtils.isNotBlank(equalCode)){
			criterias.add(Restrictions.eq("code", equalCode));
		}
	    if(StringUtils.isNotBlank(likeCode)){
			criterias.add(Restrictions.allLike("code", likeCode));
		}
		 if(StringUtils.isNotBlank(inCodes)){
			criterias.add(Restrictions.in("code", StringUtils.split(inCodes, ",")));
		}
	    if(StringUtils.isNotBlank(equalModule)){
			criterias.add(Restrictions.eq("module", equalModule));
		}
	    if(StringUtils.isNotBlank(likeModule)){
			criterias.add(Restrictions.allLike("module", likeModule));
		}
		 if(StringUtils.isNotBlank(inModules)){
			criterias.add(Restrictions.in("module", StringUtils.split(inModules, ",")));
		}
	    if(StringUtils.isNotBlank(equalType)){
			criterias.add(Restrictions.eq("type", equalType));
		}
	    if(StringUtils.isNotBlank(likeType)){
			criterias.add(Restrictions.allLike("type", likeType));
		}
		 if(StringUtils.isNotBlank(inTypes)){
			criterias.add(Restrictions.in("type", StringUtils.split(inTypes, ",")));
		}
	    if(StringUtils.isNotBlank(equalReciveId)){
			criterias.add(Restrictions.eq("reciveId", equalReciveId));
		}
	    if(StringUtils.isNotBlank(likeReciveId)){
			criterias.add(Restrictions.allLike("reciveId", likeReciveId));
		}
		 if(StringUtils.isNotBlank(inReciveIds)){
			criterias.add(Restrictions.in("reciveId", StringUtils.split(inReciveIds, ",")));
		}
	    if(StringUtils.isNotBlank(equalSendId)){
			criterias.add(Restrictions.eq("sendId", equalSendId));
		}
	    if(StringUtils.isNotBlank(likeSendId)){
			criterias.add(Restrictions.allLike("sendId", likeSendId));
		}
		 if(StringUtils.isNotBlank(inSendIds)){
			criterias.add(Restrictions.in("sendId", StringUtils.split(inSendIds, ",")));
		}
	    if(StringUtils.isNotBlank(equalData)){
			criterias.add(Restrictions.eq("data", equalData));
		}
	    if(StringUtils.isNotBlank(likeData)){
			criterias.add(Restrictions.allLike("data", likeData));
		}
		 if(StringUtils.isNotBlank(inDatas)){
			criterias.add(Restrictions.in("data", StringUtils.split(inDatas, ",")));
		}
	    if(StringUtils.isNotBlank(equalExpandData)){
			criterias.add(Restrictions.eq("expandData", equalExpandData));
		}
	    if(StringUtils.isNotBlank(likeExpandData)){
			criterias.add(Restrictions.allLike("expandData", likeExpandData));
		}
		 if(StringUtils.isNotBlank(inExpandDatas)){
			criterias.add(Restrictions.in("expandData", StringUtils.split(inExpandDatas, ",")));
		}
	}
}